<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','admin');
?>
<script type="text/javascript">
<!--
	$(function(){
	    $.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({description:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
	    $("#title").formValidator({onshow:"<?php echo L("input").L('title')?>",onfocus:"<?php echo L("input").L('title')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('title')?>"});
	    $("#thumb").formValidator({onshow:"<?php echo L("input").L('data_thumb')?>",onfocus:"<?php echo L("input").L('data_thumb')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('data_thumb')?>"});
 	    $("#data_url").formValidator({onshow:"<?php echo L("input").L('url')?>",onfocus:"<?php echo L("input").L('url')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('url')?>"}).regexValidator({regexp:"^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$",onerror:"<?php echo L('data_onerror')?>"})
        $('#style').formValidator({onshow:"<?php echo L('select_style')?>",onfocus:"<?php echo L('select_style')?>",oncorrect:"<?php echo L('right_all')?>"}).inputValidator({min:1,onerror:"<?php echo L('select_style')?>"});
	})
//-->
</script>

<div class="pad_10">
<form action="?m=picture_fast&c=picture_data&a=add" method="post" name="myform" id="myform">
<table cellpadding="2" cellspacing="1" class="table_form" width="100%">

	<tr id="thumb_data">
		<th width="100"><?php echo L('data_thumb')?>：</th>
		<td><?php echo form::new_images('data[thumb]', 'thumb', '', 'picture_fast')?></td>
	</tr>

 
	<tr>
		<th><?php echo L('description')?>：</th>
		<td><textarea name="data[description]" id="description" cols="50"
			rows="6"></textarea></td>
	</tr>

    <tr>
        <th width="100"><?php echo L('copyfrom')?>：</th>
        <td><input type="text" name="data[copyfrom]" id="copyfrom"
                   size="30" class="input-text"></td>
    </tr>
    <tr>
        <th width="100"><?php echo L('photographer')?>：</th>
        <td><input type="text" name="data[photographer]" id="data_photographer"
                   size="30" class="input-text"></td>
    </tr>

<tr>
		<th></th>
		<td><input type="hidden" name="forward" value="?m=picture_fast&c=picture_data&a=add">
		<input type="hidden" name="pf_id" value="<?php echo $pf_id ?>">
        <input type="submit" name="dosubmit" id="dosubmit" class="dialog"
		value=" <?php echo L('submit')?> "></td>
	</tr>

</table>
</form>
</div>
</body>
</html>
<script type="text/javascript">
    function load_file_list(id) {
        if (id=='') return false;
        $.getJSON('?m=admin&c=category&a=public_tpl_file_list&style='+id+'&module=data&templates=show&name=data&pc_hash='+pc_hash, function(data){$('#show_template').html(data.show_template);});
    }
</script>